%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/v4/simple-procedure-computed-fields.simplified"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 6, 9, 10, 42, 11, 36<br />2: PgSelectInlineApply[38]<br />3: PgSelect[8]<br />ᐳ: Access[39]<br />4: Connection[12]<br />5: ConnectionItems[14]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 12, 14, 42, 39<br /><br />ROOT Connectionᐸ8ᐳ[12]"):::bucket
    Bucket3("Bucket 3 (listItem)<br />Deps: 42, 39<br /><br />ROOT __Item{3}ᐸ14ᐳ[17]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 18, 42, 39, 17<br /><br />ROOT PgSelectSingle{3}ᐸpersonᐳ[18]<br />1: <br />ᐳ: 19, 40, 41<br />2: Connection[27]<br />3: ConnectionItems[29]"):::bucket
    Bucket6("Bucket 6 (listItem)<br /><br />ROOT __Item{6}ᐸ29ᐳ[32]"):::bucket
    Bucket7("Bucket 7 (nullableBoundary)<br />Deps: 33<br /><br />ROOT PgSelectSingle{6}ᐸpostᐳ[33]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket6
    Bucket6 --> Bucket7

    %% plan dependencies
    PgSelect8[["PgSelect[8∈0] ➊<br />ᐸpersonᐳ"]]:::plan
    Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    PgFromExpression36{{"PgFromExpression[36∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[6]"}}:::plan
    PgSelectInlineApply38["PgSelectInlineApply[38∈0] ➊<br />More deps:<br />- Constantᐸ2ᐳ[42]"]:::plan
    Object11 & PgFromExpression36 & PgSelectInlineApply38 --> PgSelect8
    Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access9 & Access10 --> Object11
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access9
    __Value2 --> Access10
    Connection12[["Connection[12∈0] ➊<br />ᐸ8ᐳ"]]:::plan
    PgSelect8 --> Connection12
    ConnectionItems14[["ConnectionItems[14∈0] ➊"]]:::plan
    Connection12 --> ConnectionItems14
    Access39{{"Access[39∈0] ➊<br />ᐸ8.m.subqueryDetailsFor23ᐳ"}}:::plan
    PgSelect8 --> Access39
    __Item17[/"__Item[17∈3]<br />ᐸ14ᐳ"\]:::itemplan
    ConnectionItems14 ==> __Item17
    PgSelectSingle18{{"PgSelectSingle[18∈3]<br />ᐸpersonᐳ"}}:::plan
    __Item17 --> PgSelectSingle18
    Connection27[["Connection[27∈4]<br />ᐸ41ᐳ<br />More deps:<br />- Constantᐸ2ᐳ[42]"]]:::plan
    Lambda41{{"Lambda[41∈4]<br />ᐸpgInlineViaSubqueryTransformᐳ"}}:::plan
    Lambda41 --> Connection27
    List40{{"List[40∈4]<br />ᐸ39,17ᐳ"}}:::plan
    Access39 & __Item17 --> List40
    PgClassExpression19{{"PgClassExpression[19∈4]<br />ᐸ__person__...full_name”ᐳ"}}:::plan
    PgSelectSingle18 --> PgClassExpression19
    ConnectionItems29[["ConnectionItems[29∈4]"]]:::plan
    Connection27 --> ConnectionItems29
    List40 --> Lambda41
    __Item32[/"__Item[32∈6]<br />ᐸ29ᐳ"\]:::itemplan
    ConnectionItems29 ==> __Item32
    PgSelectSingle33{{"PgSelectSingle[33∈6]<br />ᐸpostᐳ"}}:::plan
    __Item32 --> PgSelectSingle33
    PgClassExpression34{{"PgClassExpression[34∈7]<br />ᐸ__post__.”headline”ᐳ"}}:::plan
    PgSelectSingle33 --> PgClassExpression34
    PgClassExpression37{{"PgClassExpression[37∈7]<br />ᐸ(1/0) /* E...ferred! */ᐳ"}}:::plan
    PgClassExpression34 o--o PgClassExpression37

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect8,Access9,Access10,Object11,Connection12,ConnectionItems14,PgFromExpression36,PgSelectInlineApply38,Access39 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item17,PgSelectSingle18 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,PgClassExpression19,Connection27,ConnectionItems29,List40,Lambda41 bucket4
    classDef bucket6 stroke:#ff1493
    class Bucket6,__Item32,PgSelectSingle33 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgClassExpression34,PgClassExpression37 bucket7

